// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
const vscode = require('vscode');

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed

/**
 * @param {vscode.ExtensionContext} context
 */
function activate(context) {
	let allItems = [
        "import ",
        "handle ",
        "handle any",
        "endhandle",
        "elsehandle ",
        "object ",
        "before()",
        "after()",
        "append()"
    ];

    const disposable = vscode.languages.registerCompletionItemProvider('pml', {
        provideCompletionItems(document, position, token, context) {
            let items = [];
            allItems.forEach(key => {
                let item = new vscode.CompletionItem(key, vscode.CompletionItemKind.Value);
                items.push(item);
            });

            return items;
        }
    });
}